<template>
  <div class="tabbar">
    <!-- 公共底部组件 -->
    <van-tabbar v-model="active" route>
      <van-tabbar-item replace to="/" icon="home-o">首页</van-tabbar-item>
       <van-tabbar-item replace to="/classify" icon="balance-list-o" 
        >分类</van-tabbar-item
      >
      <van-tabbar-item replace to="/cart" icon="shopping-cart-o" :badge="allinfo.allnum"
        >购物车</van-tabbar-item
      >
     
      <van-tabbar-item replace to="/personal" icon="friends-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: 'Tabbar',
  props: {
    title: String
  },
  data(){
    return{
      active:0
    }
  },
  computed: {
      allinfo(){
              return this.$store.getters['cart/allinfo']
          }
  },
}
</script>

<style lang="scss" scoped>
</style>